package com.zhb.cms.domain.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.zhb.cms.domain.service.UserOrgFunctionService;
import com.zhb.cms.domain.service.UserOrgMenuService;
import com.zhb.cms.domain.vo.UserOrgFunctionVO;
import com.zhb.cms.domain.vo.UserOrgMenusVO;
import com.zhb.cms.sdk.aop.InterfaceApiLabel;
import com.zhb.cms.sdk.bean.Result;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("cms/user")
@Api(description="用户领域机构功能资源服务")
public class UserOrgFunctionController {
    @Autowired
    private UserOrgFunctionService userOrgFunctionService;
    /**
     * 
    * @Title: searchOrgFunctions 
    * @Description: 查询用户的机构功能服务 
    * @author  张海滨  zhanghb22 
    * @date 2017年12月12日 下午3:57:01 
    * @return Result<List<UserOrgFunctionVO>>    返回类型
     */
	@ApiOperation(value = "userOrgFunction001-查询用户的机构功能服务", notes = "查询用户在某综合门户下的机构功能服务接口")
	@ApiImplicitParams({
		    @ApiImplicitParam(name = "userCd", value = "用户编码", required = true, dataType = "String", paramType = "path"),
		    @ApiImplicitParam(name = "orgCd", value = "机构编码", required = true, dataType = "String", paramType = "path"),
		    @ApiImplicitParam(name = "menuCd", value = "菜单编码", required = true, dataType = "String", paramType = "path"),
		    @ApiImplicitParam(name = "Zhb_Authen_Token", value = "令牌", required = false, dataType = "String", paramType = "header"),
		    @ApiImplicitParam(name = "Zhb_Business_Serialid", value = "交易流水", required = true, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Portal_Code", value = "请求方门户编码", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Menu_Code", value = "请求方菜单编码", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Node_Ip", value = "请求方节点IP", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Equip_Type", value = "客户端设备类型编码:参见主数据", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Equip_Hostname", value = "客户端设备名", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Equip_OsType", value = "客户端设备系统类型编码:见主数据", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Equip_OsVersion", value = "客户端设备系统版本信息", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Equip_BsType", value = "客户端设备浏览器类型编码:见主数据", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Zhb_Request_Equip_BsVersion", value = "客户端设备浏览器版本信息", required = false, dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "Accept", value = "接收属性", required = true, dataType = "String", paramType = "header", defaultValue = "application/json"),
			@ApiImplicitParam(name = "Accept-Charset", value = "接收字符集", required = true, dataType = "String", paramType = "header", defaultValue = "utf-8"),
			@ApiImplicitParam(name = "Content-Type", value = "内容类型", required = true, dataType = "String", paramType = "header", defaultValue = "application/json; charset=UTF-8") })
	@RequestMapping(value = "/userCd/{userCd}/orgCd/{orgCd}/menuCd/{menuCd}/orgFunctions", method = RequestMethod.GET,produces="application/json;charset=UTF-8")
	@InterfaceApiLabel(value = "userOrgFunction001",description="查询用户的机构功能服务")
	public Result<List<UserOrgFunctionVO>> searchOrgFunctions(@PathVariable String userCd,@PathVariable String orgCd,@PathVariable String menuCd,@RequestHeader HttpHeaders headers){
		Result<List<UserOrgFunctionVO>> result = userOrgFunctionService.searchOrgFunctions(userCd, orgCd, menuCd);
		return result;		
	}
}
